/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package RunDemo;

import dbconnect.DBConnect;
import dbconnect.DbInterface;
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Tuyen
 */
public class TestCore {
    public static void main(String[] args) throws SQLException {
        DBConnect db=new DBConnect("localhost","3306","accoutdb","root","tuyen771992");
        ResultSet result=db.getData();
        while(result.next()){
            int id=result.getInt(1);
            String name=result.getString(2);
            String mail=result.getString(3);
            String address=result.getString(4);
            System.out.println("id:"+id+"\tname:"+name+"\tmail:"+mail+"\taddress:"+address);
        }
//        System.out.println("finding....");
//        try {
//            DbInterface db=(DbInterface) Naming.lookup("rmi://localhost:1433/MyDB");
//            db.getConnect("localhost","3306","accoutdb","root","tuyen771992");
//            ResultSet result=db.getData();
//             while(result.next()){
//            int id=result.getInt(1);
//            String name=result.getString(2);
//            String mail=result.getString(3);
//            String address=result.getString(4);
//            System.out.println("id:"+id+"\tname:"+name+"\tmail:"+mail+"\taddress:"+address);
//        }
//        } catch (Exception ex) {
//            Logger.getLogger(TestCore.class.getName()).log(Level.SEVERE, null, ex);
//        }
    }
    
}
  
